home *** CD-ROM | disk | FTP | other *** search
- Path: anvil.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: Please Please Help! - pointer notation
- Date: 28 Feb 1996 16:17:34 -0800
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4h2rauINN90p@anvil.ugrad.cs.ubc.ca>
- References: <4gnlv9$1fh@news.mistral.co.uk> <4gtv05$45k@news.mistral.co.uk> <825462744snz@genesis.demon.co.uk>
- NNTP-Posting-Host: anvil.ugrad.cs.ubc.ca
-
- In article <825462744snz@genesis.demon.co.uk>,
- Lawrence Kirby <fred@genesis.demon.co.uk> wrote:
- >In article <4gtv05$45k@news.mistral.co.uk>
- > mikebarnard@mistral.co.uk "Mike Barnard" writes:
- >
- >>And I had loads of e-mail replies this time. The answer was (as
- >>always!) rather obvious, but I didn't realise that the absence of a
- >>whitespace doesn't matter to the compiler.
- >
- >It does matter sometimes since some tokens are prefixes to other tokens,
- >for example / and /* so
-
- This ain't Fortran, after all.
-
- The first Fortran compiler, completed after 18 person-years, began it's
- treacherous process by removing whitespace from the source. Hence, the
- statements
-
- DO I = 1,3 ( loop from 1 to 3 over variable I )
-
- and
- DOI = 1.3 ( assignment to variable DOI )
-
- both became
-
- DOI=1,3 and DOI=1.3
-
- Since DOI is a valid identifier, the Fortran compiler could not decide whether
- to tokenize as DO I, or DOI until detecting the presence of the comma.
-
- > a = b / *p;
- >
- >means something entirely different to
- >
- > a = b /*p;
-
- Not to mention:
-
- integer=3; versus int eger=3;
-
- >and consider what
- >
- > x = y+++z;
-
- Shoot. I was just perusing the ISO9899 in the library, but I forgot to check
- whether it actually specifies that the longest lexeme always takes precedence
- in the case of lexical ambiguity. Is this the case?
-
- >means. However in most cases there is no ambiguity and white-space makes
- >no difference.
-
- Are you implying that it _is_ ambiguous rather than equivalent to x = y++ +z?
- That would be rather unfortunate.
- --
-
-